﻿
namespace SBACN.WebSite.Common
{
	public static class StringEx
	{
		public static string CutTo(this string str, int maxLength, int showLength)
		{
			if(string.IsNullOrWhiteSpace(str))
				return string.Empty;

			if (str.Length > maxLength)
			{
				return str.Substring(0, showLength) + "…";
			}
			else
			{
				return str;
			}
		}
	}
}